<?php 

session_start();
// initial start page
if ( isset($_SESSION['user']) ) {
	if ( isset($_POST['logout']) ) {
		unset($_POST['logout']);
		session_unset();
		session_destroy();
		header( 'Location: login.php' );
		exit;
	}
	include 'home.php';
} else {
	include 'login.php';
}
?>
